home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * @(#) leave.c 12.1 95/05/09 SCOINC
- */
- /***************************************************************************
- *
- * Copyright (c) 1990-1993 The Santa Cruz Operation, Inc.
- *
- * All rights reserved. No part of this program or publication may be
- * reproduced, transmitted, transcribed, stored in a retrieval system,
- * or translated into any language or computer language, in any form or
- * by any means, electronic, mechanical, magnetic, optical, chemical,
- * biological, or otherwise, without the prior written permission of:
- *
- * The Santa Cruz Operation , Inc. (408) 425-7222
- * 400 Encinal St., Santa Cruz, California 95060 USA
- *
- **************************************************************************/
- /*
- * Modification History
- *
- * S002, 27-May-93, rickra
- * Changed some of the #includes......
- *
- * S001, 01-Jan-93, rickra
- * Added extern of exit();
- *
- * S000, 30-Sep-92, rickra
- * Added copyright and modification history
- */
- #include <stdio.h>
- #include <signal.h>
-
- #include <X11/Intrinsic.h>
-
- #include "include/unixincs.h"
- #include "include/buttons.h"
- #include "include/xsw.h"
-
- extern char test_log;
- extern int exit ();
-
-
- /*+-------------------------------------------------------------------------
- leave_text(text,exit_code) - leave program with message and exit code
- If exit_code == 255, do wperror
- --------------------------------------------------------------------------*/
- void
- leave_text (text, exit_code)
- char *text;
- int exit_code;
- {
- fputs ("\nxsw: ", stdout);
-
- if (text && *text)
- {
- fputs (text, stdout);
- fputs ("\n", stdout);
- }
-
- if (exit_code == 255)
- {
- extern int errno;
- extern int sys_nerr;
- extern char *sys_errlist[];
-
- if (errno < sys_nerr)
- printf ("system-provided error status: %s\n", sys_errlist[errno]);
- }
-
- #ifdef TESTING
- gct_writelog (test_log);
- exit (exit_code);
- #endif
-
- exit (exit_code);
-
- } /* end of leave_text */
-